<?php
class PhungTK_Rewrite_Ddht {
	/** EDUCATION */
	/**
	* @PARAM
		- $intType : {1:edu spec,2:product}
	* @RETURN
	*/
	public function tag($intType=1, $strName='', $intId=0, $intLang=LANGUAGE_VN) {
		$strName 	= str_replace('/', ' ', PhungTK_Function::UTF8Deaccent($strName));	
		$strPrefix	= 'tag/';				
		return HOST_FRONTEND  . $strPrefix . PhungTK_Function::convertNoVn($strName) . '.html?id=' . PhungTK_Function::dec2Hex($intId) . '&amp;type=' . $intType;
	}
	public function slugEdu($intId, $strName, $intLang) {
		$strName 	= str_replace('/', ' ', PhungTK_Function::UTF8Deaccent($strName));
        $strPrefix	= $intLang == LANGUAGE_VN ? 'xep-hang' : 'education';
		return $strPrefix . '/'.PhungTK_Function::convertNoVn($strName) . '-' . PhungTK_Function::dec2Hex($intId) . '.html';
	}
	public function slugShare($intId, $strName, $intLang=LANGUAGE_VN) {
		$strName 	= str_replace('/', ' ', PhungTK_Function::UTF8Deaccent($strName));
		$strPrefix	= $intLang == LANGUAGE_VN ? 'chia-se' : 'share';
		return $strPrefix . '/'.PhungTK_Function::convertNoVn($strName) . '-' . PhungTK_Function::dec2Hex($intId) . '.html';
	}
	public function slugEvent($intId, $strName, $intLang=LANGUAGE_VN) {
		$strName 	= str_replace('/', ' ', PhungTK_Function::UTF8Deaccent($strName));
		$strPrefix	= $intLang == LANGUAGE_VN ? 'su-kien' : 'event';
		return $strPrefix . '/'.PhungTK_Function::convertNoVn($strName) . '-' . PhungTK_Function::dec2Hex($intId) . '.html';
	}
	public function slugPromotion($intId, $strName, $intLang=LANGUAGE_VN) {
		$strName 	= str_replace('/', ' ', PhungTK_Function::UTF8Deaccent($strName));
		$strPrefix	= $intLang == LANGUAGE_VN ? 'khuyen-mai' : 'promotion';
		return $strPrefix . '/'.PhungTK_Function::convertNoVn($strName) . '-' . PhungTK_Function::dec2Hex($intId) . '.html';
	}
	public function slugSmanual($intId, $strName, $intLang=LANGUAGE_VN) {
		$strName 	= str_replace('/', ' ', PhungTK_Function::UTF8Deaccent($strName));
		$strPrefix	= $intLang == LANGUAGE_VN ? 'cam-nang' : 'share-manual';
		return $strPrefix . '/'.PhungTK_Function::convertNoVn($strName) . '-' . PhungTK_Function::dec2Hex($intId) . '.html';
	}
}
?>
